import request from "@/utils/request";

// 查询全部
const selectAllFood = () => {
    return request({
        url: `/api/food/selectAll`,
        method: 'get',
        // data: data, // 注意要传入 data
        // headers: { 'Content-Type': 'application/json;charset=utf-8' }
    });
};


// 查询全部
const addNewFood = (data) => {
    return request({
        url: `/api/food/add`,
        method: 'post',
        data: data, // 注意要传入 data
        headers: { 'Content-Type': 'application/json;charset=utf-8' }
    });
};


// update修改
const updateFood = (data) => {
    return request({
        url: `/api/food/update`,
        method: 'put',
        data: data, // 注意要传入 data
        headers: { 'Content-Type': 'application/json;charset=utf-8' }
    });
};

// 查询全部
const deleteFood = (id) => {
    return request({
        url: `/api/food/delete/${id}`,
        method: 'delete',
        // data: data, // 注意要传入 data
        // headers: { 'Content-Type': 'application/json;charset=utf-8' }
    });
};


export {selectAllFood,addNewFood, updateFood, deleteFood};
